package com.kandinfo.base.security.service;

import java.util.List;
import java.util.Map;

import com.kandinfo.base.common.dto.widget.DataTablesResponseDto;
import com.kandinfo.base.common.service.Service;
import com.kandinfo.base.security.domain.User;
import com.kandinfo.base.security.dto.UserDto;
import com.kandinfo.base.security.dto.UserSearchDto;
import com.kandinfo.base.security.repository.UserRepository;

public interface UserService extends Service<User, Long, UserRepository> {
    void deleteUser(Long id);
    
    void reuseUser(Long id);

    DataTablesResponseDto<UserDto> searchByCon(final UserSearchDto searchDto);

    User findUserById(Long id);

    User saveUser(User user);

    String findUserNameById(Long id);

    User findUserByUsername(String username);
    
    /**
     * 根据 用户名，手机号查找用户
     * 
     * @param username
     * @param mobile
     * @return
     */
    User findByUserNameAndMobile(String username, String mobile);

    boolean isUserExisted(String username);

    List<User> findByType(int type);

    // 查找活跃用户
    List<User> findActiveUser();
    
    List<User> searchPermsers(String permname);
    
    List<User> getUsersBykey();
    
    /**
     * 获取用户map, key : userId, value : user
     * @return
     */
    Map<Long, User> getUserMap();
    
    /**
     * 根据用户类型， 查找用户(关联user_info表查询)
     * @return
     */
    List<User> findByUserType(Integer userType);
}
